import requests
url='https://passport.cnblogs.com/user/signin'
headersCode={
'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 '
             'Safari/537.36'


}
s=requests.session()  #1
print(s)
response=s.get(url,headers=headersCode,verify=False) #通过上次访问的session模拟 访问
print(response.cookies['SERVERID'])
print(s.cookies)
fristCookie=requests.cookies.RequestsCookieJar()#4 创建一个空的cookies   firstCookies
fristCookie.set('.CNBlogsCookie','1E0D8937775B8D0E7C7C8031190B157568E1E6A39ED9ED44645B0F6CB2F2DCA71E38E33ADC912C367A0'
                                 '9192650048DF5B7ADC5E7734945B6D4C'
                                 'EDE5383770E3BA41FAC64C19A0B30E66396BA487DDCD94DD1F7A368E412B6316035426BA5AEEF1D6964AE')
fristCookie.set('.Cnblogs.AspNetCore.Cookies','CfDJ8PhlBN8IFxtHhqIV3s0LCDl_fOBB_dCSqPVXE-FDoUXV-Mrnz6fLBjCDmpLGRASrf8'
                                              '7jNTCoKAGkcFJLVN8gsMYYO5oKRL0J0LetEcVzUm1ap_WcgbVgJPLFri4GP8noayrBpoIYB'
                                              '0zaqmPP2h-8CBqVOSDS9Tyu5NgIhH94tsbSOXJn-2qfxzUAz6jYmYgC1rxmGVvTtD8R0gij'
                                              'qveo8wOGJHzfRUnzTJn-OvGGF8YGLKYfEdxpRRarnzsoosn6Mc8Fcp9xDhEh1dy0D14pqO'
                                              'P6_efeBi1a-x5MQwT_je4p')
print('创建一个空的cookies数组 %s' %fristCookie)
print('登陆后的账号cookie》》》%s' % fristCookie['.CNBlogsCookie'])
print('登陆后的密码cookie》》》%s' %fristCookie['.Cnblogs.AspNetCore.Cookies'])
print('账号密码cookies   》》》%s' % fristCookie)
s.cookies.update(fristCookie)   #将登陆的账号密码的cookies加入到session里面去
print(s.cookies)
print(s)
